Use Algolia’s geo search capabilities to filter results around a location.
_geoloc
attribute.
First, download the airport dataset and then import it into Algolia.
name
, city
, country
, and iata_code
.
geo
criterion. If geo
isn’t active, you can’t sort by distance.
aroundLatLng
parameter.
''
) tells Algolia to retrieve all airports
aroundLatLngViaIP
parameter.
aroundRadius
parameter. The bigger the radius, the less filtering you have.
This example sorts by distance to New York City, with a radius of 1,000 km.